﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HummingBird;
using FiveSister.BAL;

namespace HummingBird.UI
{
    public partial class Logon : System.Web.UI.Page
    {
        protected void Page_Load()
        {
            
        }

        public void btLogin_OnClick(object sender, EventArgs args)
        {
            
            if (FiveSister.BAL.User.ValidateUser(txtUsername.Text, txtPassword.Text))
            {
                FormsAuthentication.SetAuthCookie(txtUsername.Text, false);
                Session["username"] = txtUsername.Text.Trim();
                Response.Redirect("Default.aspx");
            }
            else
            {
                lblMsg.Text = "Tên đăng nhập hoặc mật khẩu không hợp lệ.";
            }
        }

    }
}